package com.hwtx.form.def.meta;

import com.google.common.collect.Lists;
import net.sf.jsqlparser.JSQLParserException;
import net.sf.jsqlparser.util.TablesNamesFinder;
import org.junit.Assert;

import java.util.Set;

public class SqlParser {

    public static void main(String[] args) throws JSQLParserException {
        String exprStr = "select 1 from sys_log";
        Set<String> tableNames = TablesNamesFinder.findTablesInExpression(exprStr);
        Assert.assertTrue(tableNames.containsAll(Lists.newArrayList("A", "B", "C")));
    }
}
